package com.iyimo.loader
{
	import com.iyimo.event.LoadEvent;
	
	import flash.events.EventDispatcher;

	/**
	 * 多项下载序列
	 * 可以归并 xml, swf, mp3 下载
	 */	
	public class LoaderSet extends MutilLoader{
		private var _mLoader:MutilLoader;
		
		public function LoaderSet(){}
		
		override public function load(value:Array = null):void{
			super.load(value);
			
			_mLoader = source[_index];
			_mLoader.addEventListener(LoadEvent.ALL_COMPLETE, onComplete);
			_mLoader.load();
		}
		
		override protected function onComplete(e:LoadEvent):void{
			_mLoader.removeEventListener(LoadEvent.ALL_COMPLETE, onComplete);
			_mLoader = null;
			
			super.onComplete(e);
		}
	}
}